export const request = (url, params = {}) => {
	return new Promise((resolve, reject) => {
		window.niceloo.api.callRaw({
			api: url,
			params,
			onsuccess: resolve,
			onerror: reject,
		});
	});
};

export function requestErrHandle(url, data) {
    return request(url, data).catch((msg) => {
        MsgBox.alert(msg.getDescription());
		return Promise.reject(msg);
    });
}